<template>
  <section>
    <!--  <el-col :xs="6" :sm="6" :md="6" :lg="6" style="height:670px;width:25%;overflow-y :auto;overflow-x :auto">
      <div style="position:relative;font-size:18px;font-weight:bold;align:center;color:#48576a;box-sizing:border-box;">机构管理
     
        <el-tree highlight-current :data="data" :props="defaultProps" @node-click="handleNodeClick" :default-expand-all="true" :expand-on-click-node="false" show-overflow-tooltip>
      
        </el-tree>
      </div>
    </el-col> -->
    <div style="display:flex;justify-content:space-between;width:100%;height:100%">
      <div style="width:20%;position:relative;">
        <div style="position:absolute;height:100%;width:100%;overflow-y:auto;overflow-x:auto">
          <el-col style="overflow:hidden;width:auto">
            <!-- -->
            <el-tree highlight-current :data="data" :props="defaultProps" @node-click="handleNodeClick" :default-expand-all="true" :expand-on-click-node="true">
            </el-tree>

          </el-col>
        </div>
      </div>
      <div style="width:80%;">
        <el-col>
          <!-- <div id="branch_right" style="position:fixed;"> -->
          <!--工具条-->
          <el-col :span="24" class="toolbar" style="padding-bottom: 0px; margin-bottom:10px;">
            <el-form :inline="true" :model="filters">
              <el-form-item>
                <el-input size="small" style="width:200px;" v-model="filters.nextBranchNo" placeholder="机构编码"></el-input>
              </el-form-item>
              <el-form-item>
                <el-input size="small" style="width:200px;" v-model="filters.nextBranchName" placeholder="机构名称"></el-input>
              </el-form-item>
              <el-form-item style="float:right;">
                <el-button type="primary" class="button_style" size="small" @click="getLogs(true)" v-show="agentBranchQuery">查询下级机构</el-button>
                <el-button type="primary" class="button_style" size="small" @click="exportExcels" v-show="agentBranchExport">导出</el-button>
                <el-button type="primary" class="button_style" size="small" @click="editTrench">修改当前机构</el-button>
                <el-button type="primary" class="button_style" size="small" @click="searchTrench">查询当前机构</el-button>
                <el-button type="primary" class="button_style" size="small" @click="addNext">添加下级机构</el-button>
              </el-form-item>
            </el-form>
          </el-col>
          <!--列表-->
          <el-table :data="branchs" stripe border :height="winHeight-195" highlight-current-row style="width: 100%;">
            <el-table-column prop="branchNo" align="center" label="机构编码" min-width="140">
            </el-table-column>
            <el-table-column prop="addressCname" align="center" label="机构地址" min-width="120" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="upperBranchNo" align="center" label="上级机构编码" min-width="140">
            </el-table-column>
            <el-table-column prop="branchCname" align="center" label="机构名称" min-width="120" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="branchLevel" align="center" label="机构等级" min-width="100">
            </el-table-column>
            <!-- <el-table-column prop="branchType" align="center" label="机构类型" min-width="120">
        </el-table-column> -->
            <el-table-column prop="phoneNumber" align="center" label="电话号码" min-width="150">
            </el-table-column>
            <el-table-column prop="postcode" align="center" label="邮政编码" min-width="100">
            </el-table-column>
            <!-- <el-table-column prop="rate" align="center" label="收益比例" min-width="120">
        </el-table-column> -->
            <el-table-column label="操作" align="center" fixed='right' min-width="120" width="140">
              <template scope="scope">
                <el-col :xs="24" :sm="12" :md="24" :lg="12">
                  <el-button size="small" @click="handleDetail(scope.$index, scope.row)">详情</el-button>
                </el-col>
                <el-col :xs="24" :sm="12" :md="24" :lg="12">
                  <el-button type="warning" size="small" @click="handleEdit(scope.$index, scope.row)">修改</el-button>
                </el-col>
              </template>
            </el-table-column>
          </el-table>
          <!--工具条-->
          <el-col :span="24" class="toolbar">
            <!-- <el-button type="danger" @click="batchRemove" :disabled="this.sels.length===0">批量删除</el-button> -->
            <!-- <el-button type="danger" size="small">批量删除</el-button> -->
            <el-pagination style="float:right" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page" :page-sizes="[10, 20, 40, 80]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total">
            </el-pagination>
          </el-col>
          <!-- </div> -->
        </el-col>
        <!-- </div> -->
      </div>
    </div>
    <!--添加下级渠道-->
    <el-dialog title="添加下级机构" v-model="addNextVisible" :close-on-click-modal="false">
      <el-form label-width="100px" :model="addNextForm" :rules="addNextFormRules" ref="addNextForm">
        <!-- <el-row> -->
        <!-- <el-col :xs="24" :sm="18" :md="12" :lg="12">
            <el-form-item label="机构编码:" prop="branchNo">
              <el-input id="mobile" v-model="addNextForm.branchNo" style="width:100%;" auto-complete="off"></el-input>
            </el-form-item>
          </el-col> -->
        <!--  <el-col :xs="24" :sm="18" :md="12" :lg="12">
            <el-form-item label="是否有效" prop="validStatus">
              <el-select v-model="addNextForm.validStatus" placeholder="请选择状态">
                <el-option label="是" value="1"></el-option>
                <el-option label="否" value="0"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row> -->
        <el-row>
          <el-col :xs="24" :sm="18" :md="12" :lg="12">
            <el-form-item label="上级机构编码:" prop="upperBranchNo">
              <el-input :disabled="true" v-model="addNextForm.upperBranchNo" style="width:100%;" auto-complete="off">
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="18" :md="12" :lg="12">
            <el-form-item label="上级机构名称:" prop="upperBranchNo">
              <el-input :disabled="true" v-model="addNextForm.upperBranchName" style="width:100%;" auto-complete="off">
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :sm="18" :md="12" :lg="12">
            <el-form-item label="中文名称:" prop="branchCname">
              <el-input v-model="addNextForm.branchCname" style="width:100%;" auto-complete="off">
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="18" :md="12" :lg="12">
            <el-form-item label="英文名称:" prop="branchEname">
              <el-input v-model="addNextForm.branchEname" style="width:100%;" auto-complete="off">
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <!-- <el-col :xs="24" :sm="18" :md="12" :lg="12">
            <el-form-item label="机构类型:" prop="branchType">
              <el-input v-model="addNextForm.branchType" :disabled="editAddNextDisable" style="width:100%;" auto-complete="off">
              </el-input>
            </el-form-item>
          </el-col> -->
          <el-col :xs="24" :sm="18" :md="12" :lg="12">
            <el-form-item label="是否有效" prop="validStatus">
              <el-select v-model="addNextForm.validStatus" placeholder="请选择状态">
                <el-option label="是" value="1"></el-option>
                <el-option label="否" value="0"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="18" :md="12" :lg="12">
            <el-form-item label="电话号码" prop="phoneNumber">
              <el-tooltip class="item" effect="dark" content="请输入电话号码" placement="top">
                <el-input v-model="addNextForm.phoneNumber" auto-complete="off"></el-input>
              </el-tooltip>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :sm="18" :md="12" :lg="12">
            <el-form-item label="邮政编码" prop="postcode">
              <el-input v-model="addNextForm.postcode" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="18" :md="12" :lg="12">
            <el-form-item label="机构地址:" prop="addressCname">
              <el-input v-model="addNextForm.addressCname" style="width:100%;" auto-complete="off">
              </el-input>
            </el-form-item>
          </el-col>
          <!-- <el-col :xs="24" :sm="18" :md="12" :lg="12">
            <el-form-item label="收益比例:" prop="rate">
              <el-input v-model.number="addNextForm.rate" style="width:100%;" auto-complete="off">
              </el-input>
            </el-form-item>
          </el-col> -->
        </el-row>
        <el-row>
          <el-col :xs="24" :sm="18" :md="12" :lg="12">
            <el-form-item label="业务员收益比例" prop="saleRate" v-show="isTwo()">
              <el-input v-model.number="addNextForm.saleRate" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="18" :md="12" :lg="12">
            <el-form-item label="出单员收益比例:" prop="saleRate" v-show="isTwo()">
              <el-input v-model.number="addNextForm.issueRate" style="width:100%;" auto-complete="off">
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <!-- <el-row>
          <el-col :xs="24" :sm="18" :md="12" :lg="24">
            <el-form-item label="机构地址:" prop="addressCname">
              <el-input v-model="addNextForm.addressCname" style="width:100%;" auto-complete="off">
              </el-input>
            </el-form-item>
          </el-col>
        </el-row> -->
        <el-row>
          <el-col :xs="24" :sm="18" :md="12" :lg="24">
            <el-form-item label="备注:" prop="remark">
              <el-input v-model="addNextForm.remark" style="width:100%;" auto-complete="off">
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click.native="addNextVisible = false">取消</el-button>
        <el-button type="primary" @click.native="addNextSubmit" :loading="addLoading">提交</el-button>
      </div>
    </el-dialog>
    <!--添加下级渠道-->

    <!--修改下级渠道-->
    <el-dialog title="修改当前机构" v-model="editTrenchVisible" :close-on-click-modal="false">
      <el-form label-width="100px" :model="trenchForm" ref="trenchForm" :rules="trenchFormFormRules">
        <!-- :rules="trenchFormFormRules" -->
        <el-row>
          <el-col :xs="24" :sm="24" :md="24" :lg="20">
            <el-form-item label="机构编码:" prop="branchNo">
              <el-input v-model="trenchForm.branchNo" :disabled="true" style="width:100%;" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :sm="24" :md="24" :lg="20">
            <el-form-item label="机构中文名称:" prop="branchCname">
              <el-input v-model="trenchForm.branchCname" style="width:100%;" auto-complete="off">
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :sm="24" :md="24" :lg="20">
            <el-form-item label="机构英文名称:">
              <el-input v-model="trenchForm.branchEname" style="width:100%;" auto-complete="off">
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :sm="24" :md="24" :lg="20">
            <el-form-item label="上级机构编码:">
              <el-input v-model="trenchForm.upperBranchNo" style="width:100%;" auto-complete="off">
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <!-- <el-row>
          <el-col :xs="24" :sm="24" :md="24" :lg="20">
            <el-form-item label="机构类型:" prop="branchType">
              <el-input v-model="trenchForm.branchType" style="width:100%;" auto-complete="off">
              </el-input>
            </el-form-item>
          </el-col>
        </el-row> -->

        <el-row>
          <el-col :xs="24" :sm="24" :md="24" :lg="20">
            <el-form-item label="电话号码" prop="phoneNumber">
              <!-- :disabled="userIdDisable" -->
              <el-input v-model="trenchForm.phoneNumber" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :sm="24" :md="24" :lg="20">
            <el-form-item label="邮政编码" prop="postcode">
              <!-- :disabled="userIdDisable" -->
              <el-input v-model="trenchForm.postcode" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :sm="24" :md="24" :lg="20">
            <el-form-item label="机构地址" prop="addressCname">
              <!-- :disabled="userIdDisable" -->
              <el-input v-model="trenchForm.addressCname" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <!--  <el-row>
          <el-col :xs="24" :sm="24" :md="24" :lg="20">
            <el-form-item label="收益比例:" prop="rate">
              <el-input v-model="trenchForm.rate" style="width:100%;" auto-complete="off">
              </el-input>
            </el-form-item>
          </el-col>
        </el-row> -->
        <el-row>
          <el-col :xs="24" :sm="24" :md="24" :lg="20">
            <el-form-item label="业务员收益比例" prop="saleRate" v-show="isTwoBranch()">
              <el-input v-model.number="trenchForm.saleRate" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :sm="24" :md="24" :lg="20">
            <el-form-item label="出单员收益比例:" prop="saleRate" v-show="isTwoBranch()">
              <el-input v-model.number="trenchForm.issueRate" style="width:100%;" auto-complete="off">
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click.native="editTrenchVisible = false">取消</el-button>
        <el-button type="primary" @click.native="editSubmit" :loading="addLoading">确认</el-button>
      </div>
    </el-dialog>
    <!--修改下级渠道-->

    <!--渠道信息查询-->
    <el-dialog title="机构信息查询" v-model="searchTrenchVisible" :close-on-click-modal="false">
      <el-form :model="searchTrenchForm" label-width="100px" ref="searchTrenchForm">
        <el-row>
          <el-col :xs="24" :sm="24" :md="12" :lg="12" class="detaillabel">
            <label class="detailLabel">机构编码:</label>
            <span class="examineFonts">{{searchTrenchForm.branchNo}}</span>
          </el-col>
          <el-col :xs="24" :sm="24" :md="12" :lg="12" class="detaillabel">
            <label class="detailLabel">上级机构编码:</label>
            <span class="examineFonts">{{searchTrenchForm.upperBranchNo}}</span>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :sm="24" :md="12" :lg="12" class="detaillabel">
            <label class="detailLabel">电话号码:</label>
            <span class="examineFonts">{{searchTrenchForm.phoneNumber}}</span>
          </el-col>
          <el-col :xs="24" :sm="24" :md="12" :lg="12" class="detaillabel">
            <label class="detailLabel">邮政编码:</label>
            <span class="examineFonts">{{searchTrenchForm.postcode}}</span>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :sm="24" :md="12" :lg="12" class="detaillabel">
            <label class="detailLabel">机构类型:</label>
            <span class="examineFonts">{{searchTrenchForm.branchType}}</span>
          </el-col>
          <el-col :xs="24" :sm="24" :md="12" :lg="12" class="detaillabel">
            <label class="detailLabel">机构等级:</label>
            <span class="examineFonts">{{searchTrenchForm.branchLevel}}</span>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :sm="24" :md="12" :lg="12" class="detaillabel">
            <label class="detailLabel">机构状态:</label>
            <span class="examineFonts">{{searchTrenchForm.validStatus}}</span>
          </el-col>
          <el-col :xs="24" :sm="24" :md="12" :lg="12" class="detaillabel">
            <label class="detailLabel">收益比例:</label>
            <span class="examineFonts">{{searchTrenchForm.rate}}</span>
          </el-col>
        </el-row>
        <el-row>
          <el-row>
            <el-col :xs="24" :sm="24" :md="12" :lg="12" class="detaillabel">
              <label class="detailLabel">中文名称:</label>
              <span class="examineFonts">{{searchTrenchForm.branchCname}}</span>
            </el-col>
            <el-col :xs="24" :sm="24" :md="12" :lg="12" class="detaillabel">
              <label class="detailLabel">英文名称:</label>
              <span class="examineFonts">{{searchTrenchForm.branchEname}}</span>
            </el-col>
          </el-row>
          <el-col :xs="24" :sm="24" :md="24" :lg="24" class="detaillabel">
            <label class="detailLabel">机构地址:</label>
            <span class="examineFonts">{{searchTrenchForm.addressCname}}</span>
          </el-col>
        </el-row>

        <!--  <el-row>
          <el-col :xs="20" :sm="20" :md="20" :lg="20" :offset="4" class="detaillabel">
            <el-checkbox v-model="searchTrenchForm.canScore"  disabled>下级收益获取方式为积分提现</el-checkbox> -->
        <!-- <el-checkbox v-model="searchTrenchForm.canModify" disabled>允许手机端修改店铺配置信息</el-checkbox> -->
        <!-- </el-col>
        </el-row> -->
        <el-row v-show="registerUrlVisible">
          <el-col :xs="20" :sm="20" :md="20" :lg="20" :offset="4" class="detaillabel">
            <el-button type="warning" @click="preview">二维码注册</el-button>
          </el-col>
        </el-row>

      </el-form>
      <div slot="footer" align="center" class="dialog-footer">
        <el-button @click.native="cancel">取消</el-button>
      </div>
    </el-dialog>

    <!--渠道信息查询-->

    <!--详情界面-->
    <el-dialog title="详情" v-model="detailFormVisible" :close-on-click-modal="false">
      <el-form :model="detailForm" label-width="100px" ref="detailForm">
        <el-row>
          <el-col :xs="24" :sm="24" :md="12" :lg="12" class="detaillabel">
            <label class="detailLabel">机构编码:</label>
            <span class="examineFonts">{{detailForm.branchNo}}</span>
          </el-col>
          <el-col :xs="24" :sm="24" :md="12" :lg="12" class="detaillabel">
            <label class="detailLabel">上级机构编码:</label>
            <span class="examineFonts">{{detailForm.upperBranchNo}}</span>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :sm="24" :md="12" :lg="12" class="detaillabel">
            <label class="detailLabel">中文名称:</label>
            <span class="examineFonts">{{detailForm.branchCname}}</span>
          </el-col>
          <el-col :xs="24" :sm="24" :md="12" :lg="12" class="detaillabel">
            <label class="detailLabel">英文名称:</label>
            <span class="examineFonts">{{detailForm.branchEname}}</span>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :sm="24" :md="12" :lg="12" class="detaillabel">
            <label class="detailLabel">机构类型:</label>
            <span class="examineFonts">{{detailForm.branchType}}</span>
          </el-col>
          <el-col :xs="24" :sm="24" :md="12" :lg="12" class="detaillabel">
            <label class="detailLabel">机构等级:</label>
            <span class="examineFonts">{{detailForm.branchLevel}}</span>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :sm="24" :md="12" :lg="12" class="detaillabel">
            <label class="detailLabel">电话号码:</label>
            <span class="examineFonts">{{detailForm.phoneNumber}}</span>
          </el-col>
          <el-col :xs="24" :sm="24" :md="12" :lg="12" class="detaillabel">
            <label class="detailLabel">邮政编码:</label>
            <span class="examineFonts">{{detailForm.postcode}}</span>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :sm="24" :md="12" :lg="12" class="detaillabel">
            <label class="detailLabel">收益比例:</label>
            <span class="examineFonts">{{detailForm.rate}}</span>
          </el-col>
          <el-col :xs="24" :sm="24" :md="12" :lg="12" class="detaillabel">
            <label class="detailLabel">状态:</label>
            <span class="examineFonts">{{detailForm.validStatus}}</span>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :sm="24" :md="24" :lg="24" class="detaillabel">
            <label class="detailLabel">机构地址:</label>
            <span class="examineFonts">{{detailForm.addressCname}}</span>
          </el-col>
        </el-row>
        <!-- <el-row>
          <el-col :xs="20" :sm="20" :md="20" :lg="20" :offset="4" class="detaillabel">
            <el-checkbox v-model="detailForm.canScore" disabled>下级收益获取方式为积分提现</el-checkbox> -->
        <!-- <el-checkbox v-model="detailForm.canModify" disabled>允许手机端修改店铺配置信息</el-checkbox> -->
        <!--  </el-col>
        </el-row> -->
        <el-row v-show="registerUrlVisible">
          <el-col :xs="20" :sm="20" :md="20" :lg="20" :offset="4" class="detaillabel">
            <el-button type="warning" @click="preview">二维码注册</el-button>
          </el-col>
        </el-row>

      </el-form>
      <div slot="footer" align="center" class="dialog-footer">
        <el-button @click.native="cancel">取消</el-button>
      </div>
    </el-dialog>
    <!-- 二维码预览 -->
    <el-dialog size="tiny" v-model="qrcodeVisible" align="center" :close-on-click-modal="false">
      <el-row>
        <el-col :xs="12" :sm="24" :md="12" :lg="24" class="qrcodeLabel">
          <span class="examineFonts">{{detailForm.shopName}}</span>
        </el-col>
      </el-row>
      <el-row>
        <div id="qrcode" style="width:240px; height:240px;">

        </div>
      </el-row>
    </el-dialog>
  </section>
</template>

<script>
import util from '../../common/js/util'

import commons from '../../common/js/common'
//import NProgress from 'nprogress'
import { mapState, mapActions } from 'vuex'
import { findBySql, updatePwdByUserCode, levelList, branchManage, updateChannelUser, isMergeUser, treeNextBranchList, nextBranchList, thisChannel, orderAuth, isHasIdnumber } from '../../api/api';
import QRCode from 'qrcodejs2';
import encode from '../../common/js/encryption';
export default {
  data() {

    var phone = (rule, value, callback) => {
      if (!value) {
        return callback(new Error('手机号码不能为空'));
      }
      else {
        if (!(/^\d{11}$/.test(value))) {
          return callback(new Error('请输入正确的手机号码'));
        }
        else {
          return callback();
        }
      }
    };
    var IDCardValid = (rule, value, callback) => {
      if (this.addNextForm.idType == '1' || this.trenchForm.idType == '1') {
        if (!value) {
          return callback(new Error('身份证号码不能为空'));
        }
        else {
          if (!(/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(value))) {
            return callback(new Error('请输入正确的身份证号码'));
          }
          else {
            if (this.idNumberVisible) {
              console.log("==========================");
              let para = new FormData();
              para.append('idNumber', value);
              isHasIdnumber(para).then((res) => {
                if (res.data.state == 1) {
                  this.$message({
                    message: res.data.result,
                    type: 'success'
                  });
                }
              });
            }
            return callback();
          }
        }
      } else {
        let para = new FormData();
        para.append('idNumber', value);
        isHasIdnumber(para).then((res) => {
          if (res.data.state == 1) {
            this.$message({
              message: res.data.result,
              type: 'success'
            });
          }
        });
        return callback();
      }
    };
    var helpText = (rule, value, callback) => {
      if (value == 0 || value == '0') {
        return callback();
      }
      if (commons.isEmpty(value)) {
        return callback(new Error('比例不能为空'));
      } else if (!(/^-?\d+(\.\d{1,6})?$/.test(value))) {
        return callback(new Error('小数不能超过6位'));
      }
      else {
        if (value > 1) {
          return callback(new Error('比例不能大于1'));
        }
        else {
          return callback();
        }
      }
    };
    var editHelpText = (rule, value, callback) => {
      if (this.registerUrlVisible) {
        if (value == 0 || value == '0') {
          return callback();
        }
        if (commons.isEmpty(value)) {
          return callback(new Error('比例不能为空'));
        } else if (!(/^-?\d+(\.\d{1,6})?$/.test(value))) {
          return callback(new Error('小数不能超过6位'));
        }
        else {
          if (value > 1) {
            return callback(new Error('比例不能大于1'));
          }
          else {
            return callback();
          }
        }
      } else {
        return callback();
      }
    };
    var realName = (rule, value, callback) => {
      if (!value) {
        return callback(new Error('真实姓名不能为空'));
      } else if (!(/^[\u4E00-\u9FA5\uf900-\ufa2d·s]{2,20}$/.test(value))) {
        return callback(new Error('请输入格式正确的中文姓名'));
      }
      else {
        return callback();
      }
    };

    var validateMobileno = (rule, value, callback) => {

      if (!value) {

        return callback(new Error('手机号码不能为空'));
      } else if (!( /^\d{11}$/.test(value))) {
        return callback(new Error('手机号格式不正确'));
      }
      else {
        if (!this.validateMobile) {
          let para = new FormData();
          para.append('mobile', value);
          para.append('comCode', this.comCode);
          isMergeUser(para).then((res) => {
            if (res.data.result) {
              this.$message({
                message: "该手机已被使用！",
                type: 'error'
              });
            } else {
              this.ruleOfAddNext = true;
              this.editPassBtnVisible = false;
              this.addNewPassVisible = true;
            }
          });
          this.validateMobile = true;
        }
        return callback();
      }

    };
    return {
      filters: {
        nextBranchNo: '',
        nextBranchName: '',
        branchNo: ''
      },
      branchTitle: '',
      data: [],
      defaultProps: {
        children: 'children',
        label: 'label'
      },
      selectdatas: '',
      restaurants: [{
        value: '',
        code: ''
      }],
      branchs: [],

      Logs: [],
      lists: [],
      titles: [],
      exportTotal: 0,
      total: 0,
      page: 1,
      pageSize: 10,
      loading: '',
      editindex: '',
      idNumberVisible: true,
      listLoading: false,
      editLoading: false,
      addLoading: false,
      matchLoading: false,
      examineLoading: false,
      addFormVisible: false,
      registerUrlVisible: false,
      detailFormVisible: false,
      examineFormVisible: false,
      editFormVisible: false,
      matchFormVisible: false,
      userNameVisible: false,
      userRealNameVisible: false,
      agentBranchQuery: false,
      authListSels: [],
      userid: '',
      addNextVisible: false,//显示添加下级渠道界面
      editTrenchVisible: false,//显示修改下级渠道界面
      searchTrenchVisible: false,//显示查询渠道界面
      sellShow: false,//显示业务关系代码的销售人员编码
      qrcodeVisible: false, //二维码预览
      passwordVisible: true,//显示登录密码
      editAddNextDisable: false,//添加下级渠道某些栏是否可编辑
      agrNoDisable: false,
      // canScoreDisable:false,
      userIdDisable: true,
      ruleOfAddNext: true,
      oldPassVisible: false,
      addNextChannel: false,
      agentBranchExport: false,
      agentBranchQuery: false,
      channelUpdate: false,
      thisChannel: false,
      chanelDetail: false,
      reduceAuthList: false,
      userRealNameTrenVisible: false,
      comCode: '',
      comLable: '',
      seltValue: '',
      saleNameTrench: '',
      serPresentVisible: false,//是否显示查询当前渠道，为分公司就不显示，为下级渠道就显示
      addNextBtnVisible: false,//是否显示添加下级渠道，为总公司则不显示
      channelCodeTemp: '',// 渠道编码--
      channelNameTemp: '',
      customerTypeTemp: '',// 关系代码客户类型--
      customerNameTemp: '',
      editPassVisible: false,
      editPassBtnVisible: false,
      validateMobile: false,
      addNewPassVisible: false,
      branchTemp: '',
      agentNameTemp: '',
      orgCodeTemp: '',
      licenceNoTemp: '',
      addNextForm: {
        branchCname: '',
        branchNo: '',
        branchEname: '',
        postcode: '',
        phoneNumber: '',
        rate: '',
        addressCname: '',
        addressEname: '',
        mobile: '',
        upperBranchNo: '',
        branchType: '',
        remark: '',
        validStatus: '',
        addOrUpdate: ''
      },//添加下级渠道界面参数
      checked: false,
      addNextFormRules: {
        branchNo: [{ required: true, message: '请输入机构编码', trigger: 'blur' }],
        branchCname: [{ required: true, message: '请输入机构名称', trigger: 'blur' }],
        validStatus: [{ required: true, message: '请选择是否有效', trigger: 'blur' }],
        // postcode: [{ required: true, message: '请输入邮政编码', trigger: 'blur' }],
        // phoneNumber: [{ required: true, message: '请输入电话号码', trigger: 'blur' }],
        rate: [{ required: true, validator: helpText, trigger: 'blur' }],
        // addressCname: [{ required: true, message: '请输入机构地址', trigger: 'blur' }],

      },
      trenchFormFormRules: {
        comCode: [{ required: true, message: '请输入上级渠道ID', trigger: 'blur' }],
        mobile: [{ required: true, message: '请输入电话号码', trigger: 'blur' }],
        idType: [{ required: true, message: '请选择证件类型', trigger: 'blur' }],
        type: [{ required: true, message: '请选择用户类型', trigger: 'blur' }],
        branchCname: [{ required: true, message: '请输入机构名称', trigger: 'blur' }],
        // postcode: [{ required: true, message: '请输入邮政编码', trigger: 'blur' }],
        upperBranchNo: [{ required: true, message: '请输入上级机构编码', trigger: 'blur' }],
        rate: [{ required: true, validator: editHelpText, trigger: 'blur' }],
        // userRealName: [{ required: this.userRealNameTrenVisible, validator: realName, trigger: 'blur' }],
        // userRealName: [{ required: true, message: '请输入真实姓名', trigger: 'blur' }],
        // customerNameTemp: [{ required: true, message: '请输入客户单位名称', trigger: 'blur' }],
      },
      trenchForm: {},
      searchTrenchForm: {},
      examineForm: {},
      detailForm: {},
      IsShow: false,
      uploadPass: false,
      // rootUrl: location.protocol + "//" + location.hostname + "/#/sticcxb/registerchannel",
      rootUrl: location.protocol + "//" + location.hostname + "/sticcxb/#/sticcxb/registeraccept",
      registerUrl: "",
    }
  },
  computed: mapState([
    'winWidth',
    'winHeight',
    'hotAreaList'
  ]),
  methods: {
    ...mapActions([
      'findHotAreaList'
    ]),
    cellStyle(row, rowIndex, columnIndex) {
    },
    formatContent: function (row, column) {
      return JSON.stringify(row);
    },
    handleCurrentChange(val) {
      this.page = val;
      this.getLogs(true);
    },
    handleSizeChange(val) {
      this.pageSize = val;
      this.getLogs(true);
    },
    editPassBtn: function () {
      if (this.editPassVisible) {
        this.editPassVisible = false;
      } else {
        this.editPassVisible = true;
      }
    },
    // 业务关系代码-----销售人员及编码---添加下级渠道
    handleSelect() {
      console.log(this.selectdatas)
      console.log(this.restaurants)
      for (var i in this.restaurants) {
        if (this.restaurants[i].code == this.selectdatas && this.selectdatas != "") {
          this.addNextForm.saleName = this.restaurants[i].value.split('-')[0];
          this.addNextForm.saleCode = this.restaurants[i].code;
        }
      }
    },
    // 业务关系代码-----销售人员及编码-----修改下级渠道
    handleSelectEdit() {
      for (var i in this.restaurants) {
        if (this.restaurants[i].code == this.selectdatas && this.selectdatas != "") {
          this.trenchForm.saleName = this.restaurants[i].value.split('-')[0];
          this.trenchForm.saleCode = this.restaurants[i].code;
        }
      }
    },
    visibleSelect(bool) {
      if (bool) {
        this.selectData();
      }
    },
    visibleSelectEdit(bool) {
      if (bool) {
        this.selectDataEdit();
      }
    },
    blurSelect(Event) {
      // this.selectdatas = "";
      this.selectData();
    },
    blurSelectEdit(Event) {
      this.selectDataEdit();
    },

    helptext: function (value) {
      if (value == null || value == " " && !value == '0' || value.length == 0) {
        return '比例不能为空';
      }
      else if (!(/^-?\d+(\.\d{1,6})?$/.test(value))) {
        return '小数不能超过6位';
      }
      else if (value > 1) {
        return '比例不能大于1';
      }
      else {
        return '';
      }
    },

    // 点击树节点回调
    handleNodeClick: function (data, node, obj) {
      this.branchTitle = data.label;
      this.comCode = data.id;
      this.filters.branchNo = data.id;
      this.comLable = data.label;

      let para = new FormData();
      para.append('branchNo', data.id);
      treeNextBranchList(para).then((res) => {
        if (res.data.result && res.data.success == true) {
          this.branchs = res.data.result;
          for (let i in res.data.result) {
            const newChild = { id: res.data.result[i].branchNo, label: res.data.result[i].branchCname, children: [] };
            if (!data.children) {
              this.$set(data, 'children', []);
            }
            if (typeof (commons.GetByID(this.data, res.data.result[i].branchNo)) == 'undefined') {
              data.children.push(newChild);
            }
          }
        }
      });

      // let paraChannel = new FormData();
      // paraChannel.append('userCode', this.comCode);
      // thisChannel(paraChannel).then((channelRes) => {
      //   console.log(channelRes);
      //   let thisChannelResult = channelRes.data.result;
      //      if (thisChannelResult.canScore=="1") {
      //       this.canScoreDisable=true;
      //     }
      // });



      this.getLogs(true);

    },
    editTrench: function () {
      this.editTrenchVisible = true;
      let para = new FormData();
      para.append('userCode', this.comCode);
      thisChannel(para).then((res) => {
        // if (res.data.result.registerType==1) {
        //   this.registerUrlVisible = true;
        //   let uuid = encode.hex_md5(res.data.result.userCode + ":1");
        //   this.registerUrl = this.rootUrl + "?shareId=" + uuid;
        // }
        this.trenchForm = res.data.result;
        // this.searchTrenchForm.shopName = res.data.result.refereeUser.shopName;
        // this.searchTrenchForm.comCode = res.data.result.refereeUser.userCode;
        // this.trenchForm.idType = this.trenchForm.idType == 1 ? '身份证' : '统一社会信用代码';
        // this.searchTrenchForm.branchCode = commons.Branchs(this.searchTrenchForm.branchCode);
        // this.detailForm.shopName = this.searchTrenchForm.shopName;//二维码注册的渠道名称
        // this.trenchForm.storeFlag = this.trenchForm.storeFlag == "1" ? "是" : "否";
        // this.searchTrenchForm.userType = commons.customType(this.searchTrenchForm.userType);
        // if (this.searchTrenchForm.canModify == '1') {
        //   this.searchTrenchForm.canModify = true;
        // } else {
        //   this.searchTrenchForm.canModify = false;
        // }
        // if (this.searchTrenchForm.canScore == '1') {
        //   this.searchTrenchForm.canScore = true;
        // } else {
        //   this.searchTrenchForm.canScore = false;
        // }
      });
    },
    //获取列表
    getLogs(bool) {
      this.listLoading = bool;
      if (!bool) {
        this.loading = this.$loading({
          lock: true,
          text: '正在导出',
          spinner: 'el-icon-loading',
          background: 'rgba(0, 0, 0, 0.7)'
        });
      }

      let para = new FormData();
      para.append("pageSize", bool ? this.pageSize : this.total);
      para.append("pageNumber", bool ? this.page : 1);
      // if (this.filters.nextBranchNo) {
      para.append("nextBranchNo", this.filters.nextBranchNo);
      // }else{
      //   para.append("nextBranchNo", commons.isEmpty(this.comCode)?"00000000":this.comCode);
      // }
      console.log(this.filters.nextBranchNo);
      console.log(this.filters.nextBranchName);
      para.append("nextBranchName", this.filters.nextBranchName);
      para.append('branchNo', this.comCode);
      nextBranchList(para).then((res) => {
        console.log(res);
        if (res.data.result && res.data.success == true) {
          this.lists = res.data.result.content;
          this.total = res.data.result.totalElements;
          this.exportTotal = res.data.result.totalElements;
          if (!bool) {
            this.loading.close();
            this.export2Excel();
          } else {
            this.branchs = res.data.result.content;
          }

          // for (let i in res.data.result.content) {
          //   const newChild = { id: res.data.result.content[i].branchNo, label: res.data.result.content[i].branchCname, children: [] };
          //   if (!data.children) {
          //     this.$set(data, 'children', []);
          //   }
          //   if (typeof (commons.GetByID(this.data, res.data.result.content[i].branchNo)) == 'undefined') {
          //     data.children.push(newChild);
          //   }
          // }
        }
      });



      // nextChannelList(para).then((res) => {
      //   this.lists = res.data.result.list;
      //   this.total = res.data.result.totalElements;
      //   this.exportTotal = res.data.result.totalElements;
      //   this.listLoading = false;
      //   if (!bool) {
      //     this.loading.close();
      //     this.export2Excel();
      //   } else {
      //     this.branchs = res.data.result.list;
      //     this.total = res.data.result.total;
      //   }
      // });
    },
    // 添加下级渠道提交
    addNextSubmit: function () {
      console.log('======================');
      this.addNextForm.upperBranchNo = this.comCode;

      console.log(this.addNextForm)
      let para = this.addNextForm;
      this.addNextForm.addOrUpdate = "add";
      this.idNumberVisible = false;
      this.$refs.addNextForm.validate((valid) => {
        if (valid) {
          this.$confirm('确认提交吗？', '提示', {}).then(() => {
            branchManage(para).then((res) => {
              this.editLoading = false;
              // if (res.data.state == 11) {
              //   this.oldPassVisible = true;
              //   this.$message({
              //     message: res.data.result,
              //     type: 'error'
              //   });
              // } else {
              if (res.data.success) {
                this.$message({
                  message: '提交成功',
                  type: 'success'
                });
                this.$refs['addNextForm'].resetFields();
                this.addNextVisible = false;
                this.getLogs(true);
              }
              else {
                this.$message({
                  message: res.data.result,
                  type: 'error'
                });
              }
              // }
            }).catch(() => {
            });
          });
        }
      });

    },
    userTypeChange: function (value) {
      if (value == 0) {
        this.userNameVisible = true;
        this.userRealNameVisible = false;
      } else {
        this.userNameVisible = false;
        this.userRealNameVisible = true;
      }
    },
    isTwoBranch: function () {
      if (this.trenchForm.branchLevel && this.trenchForm.branchLevel == '2') {
        return true;
      } else {
        return false;
      }
    },
    isTwo: function () {
      if (this.addNextForm.upperBranchNo && this.addNextForm.upperBranchNo == '0000') {
        return true;
      } else {
        return false;
      }
    },
    // 添加下级机构
    addNext: function () {
      this.customerNameTemp = '';
      let paraChannel = new FormData();
      paraChannel.append('userCode', this.comCode);
      thisChannel(paraChannel).then((channelRes) => {
        console.log(channelRes);
        let thisChannelResult = channelRes.data.result;
        this.addNextForm.upperBranchNo = thisChannelResult.branchNo;
        this.addNextForm.upperBranchName = thisChannelResult.branchCname;
        console.log(thisChannelResult);

        this.addNextVisible = true;
        this.oldPassVisible = false;
        this.sellShow = false;
        this.editPassVisible = false;
        this.addNewPassVisible = false;
        this.editPassBtnVisible = false;
        this.validateMobile = false;

        // this.addNextForm = {
        //   userName: '',// 姓名
        //   nickName: '',// 昵称
        //   idType: '',    //证件类型
        //   idNumber: '',// 证件号
        //   type: 1,//用户类型 0内部用户，1外部用户
        //   password: '',// 密码
        //   userRealName: '',
        //   imgCode: '', // 图形码
        //   mobileCode: '',// 手机验证码
        //   mobile: '',  // 手机号
        //   refereeId: '',// 分享ID
        //   refereePro: '',// 分享产品ID
        //   storeFlag: '',// 是否开店
        //   comCode: '',   //所属部门--上级
        //   branchCode: '',// 机构编码
        //   agrementNo: '',// 业务关系代码
        //   agrementName: '',// 代理名称
        //   channelCode: '',// 渠道编码
        //   channelName: '',// 渠道名称
        //   saleCode: '',// 销售编码
        //   saleName: '',// 销售名称
        //   orgCode: '',// 组织机构代码
        //   licenceNo: '',// 营业执照号
        //   customerType: '',// 关系代码客户类型
        //   customerName: '',// 关系代码客户名称
        //   baseRate: '',
        //   canScore: true,
        //   canModify: '',
        //   defaultAuth: '',
        //   oldPassword: '',
        //   // isBackUser: '',
        //   // isMergeUser: 0,
        //   roleType: 1//角色 0是渠道经理  1渠道用户
        // };
        this.editAddNextDisable = false;
        this.agrNoDisable = false;
        // if (thisChannelResult.canScore=="1") {
        //   this.canScoreDisable=true;
        // }
        this.ruleOfAddNext = true;

        let brNo = this.comCode.substring(0, 2);

        if (brNo == 'BS' || brNo == 'WX') {
          this.agrNoDisable = true;
          this.addNextForm.agrementNo = thisChannelResult.agrementNo;
          this.saleNameTrench = thisChannelResult.saleName;
          if (thisChannelResult.agrementNo) {
            this.selectData();
            console.log(this.customerNameTemp);
            setTimeout(() => {
              this.addNextForm.customerName = this.customerNameTemp;
              console.log(this.customerNameTemp);
            }, 1500);
          }
        }
      });
    },

    // 查询当前渠道
    searchTrench: function () {
      this.searchTrenchVisible = true;
      this.registerUrlVisible = false;
      let para = new FormData();
      para.append('userCode', this.comCode);
      thisChannel(para).then((res) => {
        if (res.data.result.registerType == 1) {
          this.registerUrlVisible = true;
          let uuid = encode.hex_md5(res.data.result.userCode + ":1");
          this.registerUrl = this.rootUrl + "?shareId=" + uuid;
        }
        this.searchTrenchForm = res.data.result;
        // this.searchTrenchForm.shopName = res.data.result.refereeUser.shopName;
        // this.searchTrenchForm.comCode = res.data.result.refereeUser.userCode;
        this.searchTrenchForm.idType = this.searchTrenchForm.idType == 1 ? '身份证' : '统一社会信用代码';
        this.searchTrenchForm.branchCode = commons.Branchs(this.searchTrenchForm.branchCode);
        this.detailForm.shopName = this.searchTrenchForm.shopName;//二维码注册的渠道名称
        this.searchTrenchForm.storeFlag = this.searchTrenchForm.storeFlag == "1" ? "是" : "否";
        this.searchTrenchForm.userType = commons.customType(this.searchTrenchForm.userType);
        if (this.searchTrenchForm.canModify == '1') {
          this.searchTrenchForm.canModify = true;
        } else {
          this.searchTrenchForm.canModify = false;
        }
        if (this.searchTrenchForm.canScore == '1') {
          this.searchTrenchForm.canScore = true;
        } else {
          this.searchTrenchForm.canScore = false;
        }
      });
    },
    preview: function () {
      this.qrcodeVisible = true;
      $('#qrcode').html('');
      this.$nextTick(function () {
        var qrcode = new QRCode('qrcode', {
          width: 240,
          height: 240,
          colorDark: '#20a0ff',
          colorLight: '#ffffff',
          correctLevel: QRCode.CorrectLevel.H
        });
        qrcode.makeCode(this.registerUrl);
      });
    },

    //详情
    handleDetail: function (index, row) {
      this.detailForm = Object.assign({}, row);
      this.detailForm.validStatus = this.detailForm.validStatus == "1" ? "有效" : "无效";
      this.detailFormVisible = true;
    },
    cancel: function () {
      this.detailFormVisible = false;
      this.searchTrenchVisible = false;
    },
    //修改
    handleEdit: function (index, row) {
      console.log(row);
      this.editTrenchVisible = true;
      this.trenchForm = Object.assign({}, row);
    },
    //修改渠道提交
    editSubmit: function () {
      let para = this.trenchForm;
      this.trenchForm.addOrUpdate = "update";
      this.$refs.trenchForm.validate((valid) => {
        if (valid) {
          branchManage(para).then((res) => {
            console.log(para)
            this.editLoading = false;
            if (res.data.success) {
              this.$message({
                message: '提交成功',
                type: 'success'
              });
              this.editTrenchVisible = false;
              this.getLogs(true);
            }
            else {
              this.$message({
                message: res.data.result,
                type: 'error'
              });
            }
          }).catch(() => {
          });
        } else {
          console.log("yanzbutongg")
        }
      });
    },
    IsExamines: function (index, row) {
      try {
        return row.IsExamines;
      }
      catch (err) {
        return false;
      }
    },
    handleExamine: function (index, row) {
      this.examineFormVisible = true;
      this.examineForm = row;
    },
    examineSubmit: function () {
      this.$confirm('确认通过吗？', '提示', {}).then(() => {
        this.branchs[index].IsExamines = false;
      });
    },
    //table导出excel
    exportExcels: function () {
      this.getLogs(false);
    },
    export2Excel: function () {
      require.ensure([], () => {
        const { export_json_to_excel } = require('../../vendor/Export2Excel');
        const tHeader = ['机构编码', '上级机构编码', '机构名称', '机构等级', '电话号码', '邮政编码', '机构地址', '收益比例'];
        const filterVal = ['branchNo', 'upperBranchNo', 'branchCname', 'branchLevel', 'phoneNumber', 'postcode', 'addressCname', 'rate'];
        const list = this.lists;
        // for (var i in list) {
        //   if (list[i].storeFlag) {
        //     list[i].storeFlag = list[i].storeFlag == '0' ? '否' : '是';
        //   }
        //   list[i].branchCode = commons.Branchs(list[i].branchCode);
        //   list[i].idType = list[i].idType == '1' ? '身份证' : '统一社会信用代码';
        //   list[i].userType = commons.customType(list[i].userType);
        //   list[i].comCode = commons.hotArea(list[i].comCode, this.hotArea);
        // }
        const data = this.formatJson(filterVal, list);
        export_json_to_excel(tHeader, data, '渠道详情表');
      })
    },
    formatJson: function (filterVal, jsonData) {
      return jsonData.map(v => filterVal.map(j => v[j]))
    },
    getcustoms() {
      let _this = this;
      _this.data = [];
      _this.listLoading = true;
      levelList().then((res) => {
        var data = res.data.result;
        function gettree(arr, trees) {
          for (var i in arr) {
            trees.push({
              id: arr[i].branchNo,
              label: arr[i].branchCname,
              children: []
            });
            if (arr[i].nextBranch) {

              gettree(arr[i].nextBranch, commons.GetByID(trees, arr[i].branchNo).children);
            }
          }
        }
        gettree(data, _this.data);
      });
    },
    getSelectPerTree: function () {
      let para = new FormData();
      var userinfo = sessionStorage.getItem('user');
      if (userinfo) {
        var user = JSON.parse(userinfo);
      }
      var userid = user.userId;
      para.append('userId', userid);
      para.append('type', 'order');
      let modelTree = this.data;
      let leafTree = [];
      orderAuth(para).then((res) => {
        var data = res.data.result;
        if (data) {
          this.comCode = data[0].branchNo;
        }
        gettree(data, this.data);
        console.log(this.data)
      });
      function gettree(arr, trees) {
        for (var i in arr) {
          if (typeof (commons.GetByID(trees, arr[i].branchNo)) == 'undefined') {
            trees.push({
              id: arr[i].branchNo,
              label: arr[i].branchCname,
              children: []
            });
          }
          if (arr[i].nextBranch) {
            let childTree = commons.GetByID(trees, arr[i].branchNo);
            gettree(arr[i].nextBranch, childTree.children);
          }
        }
      }
      // setTimeout(() => {
      this.getLogs(true);
      // }, 100);
    },
    btnShow: function () {
      let thisData = JSON.parse(sessionStorage.getItem('181'));
      let _this = this;
      $.each(thisData, function (i, j) {
        if (thisData[i] == "addNextChannel") {
          _this.addNextChannel = true;
        }
        if (thisData[i] == "agentBranchExport") {
          _this.agentBranchExport = true;
        }
        if (thisData[i] == "agentBranchQuery") {
          _this.agentBranchQuery = true;
        }
        if (thisData[i] == "channelUpdate") {
          _this.channelUpdate = true;
        }
        if (thisData[i] == "thisChannel") {
          _this.thisChannel = true;
        }
        if (thisData[i] == "channelDetail") {
          _this.chanelDetail = true;
        }
      });
    },
  },
  mounted() {
    this.btnShow();
    $('#branch_left').css('height', this.winHeight - 70 + 'px');
    $('#branch_right').css('height', this.winHeight - 70 + 'px');
    // this.getcustoms();
    this.getSelectPerTree();
    // this.findHotAreaList();

  }
}

</script>

<style scoped>
.el-tree {
  border: 0;
}
.toolbar {
  margin: 0;
}
.detailLabel {
  /*float:left;*/
  display: inline-block;
  text-align: right;
  width: 120px;
  color: #0b80da;
  font-weight: bold;
}
.qrcodeLabel {
  float: left;
  /*display: inline-block;*/
  /*text-align: right;*/
  /*width: 100%;*/
  color: #0b80da;
  font-weight: bold;
  margin-bottom: 10px;
}
.detaillabel {
  margin-bottom: 10px;
}
.help-block {
  color: #ff4949;
  font-size: 12px;
  display: block;
}
</style>